package HLUserControl;

import HLLib.base.HLGraphics;
import HLLib.control.HLPanel;
import HLLib.control.HLUIRoot;
import HLLib.userControl.HLRechargePanel;

public class HLUIRechage extends HLUIRoot {

    private HLRechargePanel rechargePanel;

    private HLPanel prePanel;

    public HLUIRechage(HLPanel prePanel) {
        rechargePanel = new HLRechargePanel();
        this.prePanel = prePanel;
        GameButton.GetInstanse().Save();
        GameButton.GetInstanse().RefreshButton(-1, -1);
    }

    public void Logic() {
        rechargePanel.Logic();
        if (rechargePanel.result != 0) {
            removed = true;
            if (prePanel != null) {
                prePanel.Show();
            }
            result = 1;
            GameButton.GetInstanse().Load();
        }
    }

    public void Render(HLGraphics g) {
        rechargePanel.Render(g);
    }

}
